Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC and clang-cl QoL improvements #3808

Merged
merged 3 commits into from
Jan 23, 2024
Merged

Conversation

ishitatsuyuki
Copy link
Contributor

I've been playing with using clang-cl in combination with https://github.com/mstorsjo/msvc-wine to cross-compile against MSVC C/C++ runtime on Linux. You can see an example of cross file here.

Right now, the upside is smaller binary size as you don't need to link in the C/C++ runtime statically. In the future there might be other reasons to use this, such as when better STL support is wanted.

The PR is some small changes for build flags to ensure this setup works smoothly.

clang-cl has its own compiler id but supports MSVC argument conventions.
Use get_argument_syntax to recognize MSVC-like compilers generally.
clang-cl accepts both style of options but these will be generally meaningless:
- Static CRT is unnecessary.
- File alignment will be introduced in another commit.
- Wine has partial support for PDB backtrace so there is probably no need to
  insist on DWARF (which is unsupported by real MSVC anyway).
- MSVC doesn't have the weird stdcall ordinal naming convention that
  necessiates fixup and kill-at.
Useful if you want to run a MSVC build on Wine.
@doitsujin doitsujin merged commit 6199776 into doitsujin:master Jan 23, 2024
3 checks passed
@ishitatsuyuki ishitatsuyuki deleted the clang-cl branch January 25, 2024 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants